home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / exec / memory.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  2KB  |  86 lines

  1. #ifndef    EXEC_MEMORY_H
  2. #define    EXEC_MEMORY_H
  3. /*
  4. **    $Filename: exec/memory.h $
  5. **    $Release: 2.04 $
  6. **    $Revision: 36.11 $
  7. **    $Date: 90/06/11 $
  8. **
  9. **    Definitions and structures used by the memory allocation system
  10. **
  11. **    (C) Copyright 1985,1986,1987,1988,1989,1990 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_NODES_H
  16. #include "exec/nodes.h"
  17. #endif /* EXEC_NODES_H */
  18.  
  19.  
  20. /****** MemChunk ****************************************************/
  21.  
  22. struct    MemChunk {
  23.     struct  MemChunk *mc_Next;    /* pointer to next chunk */
  24.     ULONG   mc_Bytes;        /* chunk byte size    */
  25. };
  26.  
  27.  
  28. /****** MemHeader ***************************************************/
  29.  
  30. struct    MemHeader {
  31.     struct  Node mh_Node;
  32.     UWORD   mh_Attributes;    /* characteristics of this region */
  33.     struct  MemChunk *mh_First; /* first free region        */
  34.     APTR    mh_Lower;        /* lower memory bound        */
  35.     APTR    mh_Upper;        /* upper memory bound+1    */
  36.     ULONG   mh_Free;        /* total number of free bytes    */
  37. };
  38.  
  39.  
  40. /****** MemEntry ****************************************************/
  41.  
  42. struct    MemEntry {
  43. union {
  44.     ULONG   meu_Reqs;        /* the AllocMem requirements */
  45.     APTR    meu_Addr;        /* the address of this memory region */
  46.     } me_Un;
  47.     ULONG   me_Length;        /* the length of this memory region */
  48. };
  49.  
  50. #define me_un        me_Un    /* compatibility - do not use*/
  51. #define me_Reqs     me_Un.meu_Reqs
  52. #define me_Addr     me_Un.meu_Addr
  53.  
  54.  
  55. /****** MemList *****************************************************/
  56.  
  57. /* Note: sizeof(struct MemList) includes the size of the first MemEntry! */
  58. struct    MemList {
  59.     struct  Node ml_Node;
  60.     UWORD   ml_NumEntries;    /* number of entries in this struct */
  61.     struct  MemEntry ml_ME[1];    /* the first entry    */
  62. };
  63.  
  64. #define ml_me    ml_ME        /* compatability - do not use */
  65.  
  66.  
  67. /*----- Memory Requirement Types ---------------------------*/
  68. /*----- See the AllocMem() documentation for details--------*/
  69.  
  70. #define MEMF_ANY    (0L)    /* Any type of memory will do */
  71. #define MEMF_PUBLIC (1L<<0)
  72. #define MEMF_CHIP   (1L<<1)
  73. #define MEMF_FAST   (1L<<2)
  74. #define MEMF_LOCAL  (1L<<8)
  75. #define MEMF_24BITDMA (1L<<9)    /* DMAable memory within 24 bits of address */
  76.  
  77. #define MEMF_CLEAR   (1L<<16)
  78. #define MEMF_LARGEST (1L<<17)
  79. #define MEMF_REVERSE (1L<<18)
  80. #define MEMF_TOTAL   (1L<<19)    /* AvailMem: return total size of memory */
  81.  
  82. #define MEM_BLOCKSIZE    8L
  83. #define MEM_BLOCKMASK    (MEM_BLOCKSIZE-1)
  84.  
  85. #endif    /* EXEC_MEMORY_H */
  86.